package com.sx.micowell.module.course.video

import android.graphics.Color
import com.chad.library.adapter.base.BaseQuickAdapter
import com.chad.library.adapter.base.viewholder.BaseViewHolder
import com.example.mvvm.until.LogUtils
import com.miloyu.modelnet.response.CourseDetailList
import com.sx.micowell.R

/**
 * @Author: YY
 * @Time: 2021/9/25
 * @Describe TODO
 */
class ActionVideoListAdapter: BaseQuickAdapter<CourseDetailList, BaseViewHolder>(R.layout.item_action_video_list) {

    var selectIndex = 0

    override fun convert(holder: BaseViewHolder, item: CourseDetailList) {
        LogUtils.d("ActionVideoListAdapter")
        if (selectIndex == holder.adapterPosition) {
            holder.setTextColor(R.id.tv_notices_title, Color.parseColor("#00DA8B"))
        } else {
            holder.setTextColor(R.id.tv_notices_title, Color.parseColor("#FFFFFF"))
        }
        holder.setText(R.id.tv_notices_title, item.title)
        holder.setText(R.id.tv_num, "${item.actionCount}次")
    }

}